﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using GCELibrary.Current;
using ZF.BLL;

namespace ZF.WS.Person.expert
{
    public partial class _s : BLL.Page.GMPage
    {
        [PageArgument(Key = "rk", CanNull = false)]
        public string RoomKey { get; set; }
        public ChatRoom CR { get; set; }
        public Model.US_Member _member;
        protected override void CheckSafe()
        {
            
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            BLL.OnLine.Reg(this.CurrentUser);
            CR = BLL.Chat.GetChatRoom(this.RoomKey);
            if (CR == null && RoomKey!="{0}")
            {
                WarnFactory.CreateWarn(new PageWarnParameter()
                {
                    Message = "当前通话已失效",
                    Link = WarnLink.Close,
                    JscriptMode = true,
                }).Alert();
            }
            using(var dc=SiteInfo.CreateDBDataContext())
            {
                _member = dc.US_Member.FirstOrDefault(p => p.MemberId == this.CurrentUser.MemberId);
                if (_member == null)
                    throw WarnFactory.CreateWarn(WarnCode.ReocrdNoFind);
            }
        }
    }
}
